// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
// 服务列表
import Services from '@/views/service/Services';

import Service from '@/views/service/Service';

import ApiInfos from "../views/service/ApiInfos";
// 机器信息管理
import Machine from '@/views/machine/Machine';
// 货道信息管理
import MachineAisle from '@/views/machine/MachineAisle';

// 项目管理
import Project from '@/views/project/Project';

import Task from '@/views/project/Task';
/**
 * 系统管理
 */
// 用户管理
import user from '@/views/system/user';
// 菜单管理
import Module from '@/views/system/Module';
// 角色管理
import Role from '@/views/system/Role';
// 公司管理
import Organization from '@/views/system/Organization';
// 系统环境变量
import Variable from '@/views/system/Variable';
// 权限管理
import Permission from '@/views/system/Permission';
/**
 * 支付管理
 */
// 支付配置信息
import MachineConfig from '@/views/machine/MachineConfig';
// 支付配置
import Config from '@/views/project/Config';
/**
 * 数据监控
 */
// 监控查询
import druidLogin from '@/views/druid/login';

import register from '@/views/register'

// 图表界面
import statistics from '@/views/charts/statistics';

import canvas  from "../views/charts/canvas";

import file from '@/views/file/File';

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
  routes: [{
    path: '/',
    name: '',
    component: login,
    hidden: true,
    meta: {
      requireAuth: false
    }
  }, {
    path: '/login',
    name: '登录',
    component: login,
    hidden: true,
    meta: {
      requireAuth: false
    }
  },
    {
      path: '/register',
      name: '注册',
      component: register,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },
    {
      path: '/canvas',
      name: '注册',
      component: canvas,
      hidden: true,
      meta: {
        requireAuth: false
      }
    }, {
      path: '/index',
      name: '首页',
      component: index,
      iconCls: 'el-icon-tickets',
      children: [{
        path: '/service/Services',
        name: '服务列表',
        component: Services,
        meta: {
          requireAuth: true
        }
      }, {
        path: '/service/Service',
        name: '服务详情',
        component: Service,
        meta: {
          requireAuth: true
        }
      },
        {
          path: '/service/ApiInfos',
          name: 'api信息',
          component: ApiInfos,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/machine/Machine',
          name: '机器信息管理',
          component: Machine,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/machine/MachineAisle',
          name: '货道信息管理',
          component: MachineAisle,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/project/Project',
          name: '项目管理',
          component: Project,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/project/Task',
          name: '项目管理',
          component: Task,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/file/File',
          name: '文件概念里',
          component: file,
          meta: {
            requireAuth: true
          }
        }
        , {
          path: '/system/user',
          name: '用户管理',
          component: user,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/Module',
          name: '菜单管理',
          component: Module,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/Role',
          name: '角色管理',
          component: Role,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/Organization',
          name: '组织管理',
          component: Organization,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/Variable',
          name: '系统环境变量',
          component: Variable,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/Permission',
          name: '权限管理',
          component: Permission,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/machine/MachineConfig',
          name: '支付配置信息',
          component: MachineConfig,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/project/Config',
          name: '支付配置',
          component: Config,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/druid/login',
          name: '监控查询',
          component: druidLogin,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/charts/statistics',
          name: '数据可视化',
          component: statistics,
          meta: {
            requireAuth: true
          }
        }]
    }]
})
